package poo.GUI;

import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

class Finestra extends JFrame {
	public Finestra() {
		setTitle("Finestra chiudibile");
		setSize(300, 200);
		setLocation(500, 200);
		setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {// metodo callback
				System.out.println("CIAAAAAAAAAAO!");// gestione dell'evento
				System.exit(0);
			}
		});
	}
}
